"""
encoding = 'utf-8'
@author : ffine
@time   : 2022-05-16    21:38
@IDEA   : PyCharm
@goal   : 
"""
import os


labels = []


def gci(filepath):
	files = os.listdir(filepath)
	for fi in files:
		if os.path.isdir(fi):
			gci(fi)
		elif fi.endswith(".txt"):
			labels.append(fi.split(".")[0])
	print(len(labels))
	return labels


def find_pic(target, filepath):
	pic = os.listdir(filepath)
	for pi in pic:

		# print(pi+"0")
		if pi.split(".")[0] not in target and pi.endswith(".jpeg"):
			pi = os.path.join(filepath, pi)
			print(pi)
		# os.remove(pi)


print(os.path)
find_pic(gci("/home/fhy/data/train_data/VOCdevkit/VOC2012/train/labels"), "/home/fhy/data/train_data/VOCdevkit/VOC2012/train/images")
